﻿#region Usings

using System.Linq;
using System.Windows;
using System.Windows.Ink;
using System.Windows.Input;
 
#endregion

namespace ScrumTable.UI.View.Ink
{
    /// <summary>
    /// ScrumStroke
    /// </summary>
    public class ScrumStroke : Stroke
    {

        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------
    

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------
        protected Point To
        {
            get { return new Point(StylusPoints.Last().X, StylusPoints.Last().Y); }
        }

        protected Point From
        {
            get { return new Point(StylusPoints.First().X, StylusPoints.First().Y); }
        }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        protected ScrumStroke(StylusPointCollection stylusPoints, DrawingAttributes drawingAttributes)
            : base(stylusPoints, drawingAttributes)
        {
        }

        public ScrumStroke(Point from, Point to, DrawingAttributes attributes) : this(new StylusPointCollection(new Point[] { from, to }), attributes)
        {

        }

        #endregion




        #region Methods

        /// <summary>
        /// Packs the stroke to ink stroke.
        /// </summary>
        public void Pack()
        {
            Point from = From;
            Point to =  To;
            double width = to.X - from.X;
            double height = to.Y - from.Y;
            StylusPointCollection collection = new StylusPointCollection();
            StylusPoints = Pack(from, to, width, height, collection);
        }

        protected virtual StylusPointCollection Pack(Point from, Point to, double width, double height, StylusPointCollection collection)
        {
            return StylusPoints;
        }
        #endregion
        #region Events

        #endregion
    }
}
